﻿using SharedTextEditor;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XcoAppSpaces.Core;

namespace Test
{
  class Program
  {
    static void Main(string[] args)
    {
      using (XcoAppSpace space = new XcoAppSpace("tcp.port=0"))
      {
        var port = space.Connect<DocumentMessage>(Environment.MachineName + ":8000");
        var message = new DocumentMessage();
        message.ResponsePort = space.Receive<DocumentMessage>(msg =>
        {
          if (msg.Id != null)
          {
            Console.WriteLine("Got server response");
            //document = msg.Document;
            //docServer.Document = document;
          }
        });
        port.Post(message);

        Console.ReadLine();
      }
    }
  }
}
